package com.techburg.xbrl.client;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;

public class FetchDataWidget extends Composite implements ClickHandler {
  
  private TextBox cikText = new TextBox();
  private TextBox accessionText = new TextBox();
  private Button downloadButton = new Button("Download");
  
  public FetchDataWidget() {
    VerticalPanel panel = new VerticalPanel();
    FlexTable table = new FlexTable();
    table.setText(0, 0, "CIK");    
    table.setWidget(0, 1, cikText);
    table.setText(1, 0, "Accession number");
    table.setWidget(1, 1, accessionText);
    panel.add(table);
    panel.add(downloadButton);
    
    initWidget(panel);
  }
  
  public void onClick(ClickEvent event) {
    Object sender = event.getSource();
    if (sender == downloadButton) {
      // process request
    }
  }

}
